package com.fang.unittest;

import java.io.Serializable;

public class Student implements Serializable {
    //序列化运行时将每个可序列化的类与称为serialVersionUID的版本号相关联
    static final long serialVersionUID = 42L;
    //如果对用户的名字进行保密的话，需要加transient
    private transient String stuName;
    private int stuAge;
    private boolean stuSex;

    //提供一个无参构造

    public Student() {
    }

    public Student(String stuName, int stuAge, boolean stuSex) {
        this.stuName = stuName;
        this.stuAge = stuAge;
        this.stuSex = stuSex;
    }
    //提供getter、setter方法

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public int getStuAge() {
        return stuAge;
    }

    public void setStuAge(int stuAge) {
        this.stuAge = stuAge;
    }

    public boolean isStuSex() {
        return stuSex;
    }

    public void setStuSex(boolean stuSex) {
        this.stuSex = stuSex;
    }
    //提供toString方法，以便测试时使用

    @Override
    public String toString() {
        return "Student{" +
                "stuName='" + stuName + '\'' +
                ", stuAge=" + stuAge +
                ", stuSex=" + stuSex +
                '}';
    }
}
